/**
 * Created by wuhaiyang on 2017/4/11.
 */

import React, {Component} from 'react'

import {
    View,
    Image,
    StyleSheet
} from 'react-native'
import HomePage from './HomePage'
import NavigationToolbar from '../widget/NavigationToolbar'
import NavigationToolbar1 from '../widget/NavigationToolbar1'
export default class SplashPage extends Component {
    constructor(props) {
        super(props)
    }

    componentDidMount() {
        this.timer = setTimeout(() => {
            this.props.navigator.resetTo({
                component: HomePage,
                ...this.props
            })
        }, 1000)
    }

    componentWillUnmount() {
        this.timer && clearTimeout(this.timer)
    }

    render() {
        return (
            <View style={styles.container}>
                <NavigationToolbar1
                    title={'启动页'}
                />
            </View>
        )
    }
}
const styles = StyleSheet.create({
    container: {
        flex: 1,
        backgroundColor: 'gray'
    }
})
